﻿<?php
  @header("content-Type: text/html; charset=utf-8"); //语言强制
  
  $hotKeyword = urldecode($_GET['keyword']);
  if (empty($hotKeyword)){
  	$hotKeyword = '客户信用交易担保证券账户';
  }
  
  $specialTitle = $hotKeyword.'买了什么股, '.$hotKeyword.'教你怎么炒股';
    
	require_once('head.php');
?>

<link rel="stylesheet" href="/css/table.css" type="text/css"/>

<br/>

<table class="t1"> 
<thead><th>序号</th><th>股东</th><th>时间</th><th>股票代码</th><th>股票名称</th><th>占股数量</th><th>占股比例</th></thead>
 
<?php  
  // Connect to the database 
  $dbc = mysqli_connect('localhost', 'root', 'k00l@1D;', 'gudahu')
    or die('Error connecting to MySQL server.');
	mysqli_set_charset($dbc, 'utf8');
  // Retrieve the score data from MySQL
  $query = "SELECT th.holder_name, th.appear_date, th.stock_code, s.name, th.share_amount, th.share_ratio FROM top_holder th inner join stock s on th.stock_code = s.code where th.holder_name like '%".$hotKeyword."%' order by th.appear_date desc, th.share_ratio desc";
  $result = mysqli_query($dbc, $query)
    or die('Error querying database.');  
  $isLine2 = false;
  $seq = 1;
  while ($row = mysqli_fetch_array($result)) {   	  
  	  if ($isLine2) {
  	  	echo '<tr class="a1">';
  	  	$isLine2 = false;
  	  } else {
  	  	echo '<tr>';
  	  	$isLine2 = true;
  	  }
  	  
      echo '<td>'.$seq.'</td>';
      echo '<td>'.$row['holder_name'].'</td>';
      echo '<td>'.$row['appear_date'].'</td>';
      echo '<td><a target="_blank" href="http://www.gudahu.com/topHolderDetail.php?code='.$row['stock_code'].'">'.$row['stock_code'].'</a></td>';
      echo '<td>'.$row['name'].'</td>';
      echo '<td>'.$row['share_amount'].'</td>';
      echo '<td>'.$row['share_ratio'].'%</td>';
      echo '</tr>';
      $seq++;
  }					    
  mysqli_close($dbc);
?>

</table>

<br/>
<!-- Baidu Button BEGIN -->
<div id="bdshare" class="bdshare_t bds_tools get-codes-bdshare">
<span class="bds_more">分享到：</span>
<a class="bds_qzone"></a>
<a class="bds_tsina"></a>
<a class="bds_tqq"></a>
<a class="bds_renren"></a>
<a class="bds_t163"></a>
<a class="shareCount"></a>
</div>
<script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=749342" ></script>
<script type="text/javascript" id="bdshell_js"></script>
<script type="text/javascript">
document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000)
</script>
<!-- Baidu Button END -->

<?php
	require_once('foot.php');
?>  
